<template>
    <div>
        <h2 @click="open">子组件</h2>
      父组件给的值  {{childCom}}  
    </div>
</template>

<script>
export default {
  data() {
    return {
      father: "子组件数据"
    };
  },
  methods: {
    open() {
      this.$emit("showbox", this.father); 
    }
  },
  props: ["childCom"]
};
</script>
